package demos;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import com.umpay.http.platform2.HttpUtil;
import com.umpay.sp.util.StringUtil;

/**
 * 请求CRM应用例子
 * @author hopeone
 *
 */
public class HttpRequestCrm {
	public static void main(String[] args) throws IllegalArgumentException, IOException {
		Map<String,Object> reqMap = new HashMap<String,Object>();
		String rpid = "testumf123456";//流水号生成规则
		String cardId = "6222020200074742525";//模拟卡号
		String bankId = "00033000";//固定通道号
		reqMap.put("rpid", rpid);
		reqMap.put("cardId", cardId);
		reqMap.put("bankId", bankId);
		String uri = "http://10.10.77.76:9918/restUserManager/rest2/CardBinSearch/CardBinSearch.xml";
		/**
		 * 请求CRM使用的工具类
		 */
		Map<String,Object> resMap = HttpUtil.httpPostXStream2XStream(uri, reqMap);
		System.out.println(resMap);
		String retCode = StringUtil.trim(resMap.get("retCode"));
		/**
		 * 根据返回码做出相应的业务逻辑处理
		 * 返回码retCode=0000时,表示本次请求成功
		 */
		System.out.println(retCode);
		
	}
}
